﻿using UnityEngine;

namespace Yoozoo.Gameplay.RTS
{
    [System.Serializable]
    public class GPUSkinning_Animation
    {
        public int animType = -1;
        public string animName = null;
        public GPUSkinning_BoneAnimationFrame[] frames = null;
        public GPUSkinning_BoneAnimationEvent[] events = null;
        public GPUSkinning_BoneTransform[] mountPoints = null;
        public float length = 0;
        public int fps = 0;
        public int frameCount = 0;
        public int frameStartIndex = 0;
    }

    [System.Serializable]
    public class GPUSkinning_AllBoneAnimation : ScriptableObject
    {
        public GPUSkinning_StateParameter[] parameters = null;
        public GPUSkinningAnimatorState[] m_AllStates = null;
        public string defaultStateName;
        public string name;
        public string[] mountPoints;
    }

    [System.Serializable]
    public class GPUSkinning_StateParameter
    {
        public string name;
        public int hashCode;
        public float value;
    }

    [System.Serializable]
    public class GPUSkinning_BoneAnimationFrame
    {
        public Matrix4x4[] matrices = null;
    }

    [System.Serializable]
    public class GPUSkinning_BoneTransform
    {
        public Vector3[] positions;
        public Vector3[] rotations;
    }

    [System.Serializable]
    public class GPUSkinning_BoneAnimationEvent
    {
        public float time;
        public string functionName;
        public int intParameter;
    }

    [System.Serializable]
    public class GPUSkinning_BoneAnimation
    {
        public int animType=-1;
        
        public string animName = null;

        public GPUSkinning_BoneAnimationFrame[] frames = null;
        public GPUSkinning_BoneTransform[] mountPoints = null;
        public GPUSkinning_BoneAnimationEvent[] events = null;

        public float length = 0;/*seconds*/

        public int fps = 0;
        public int frameCount = 0;

        public int m_FrameStartIndex = 0;
    }

    [System.Serializable]
    public class GPUSkinning_Bone
    {
        public bool isTopNode = false;

        public bool hasNotFoundParentTopNode = false;
        public Transform transform = null;

        public Matrix4x4 bindpose;
    }

    //[System.Serializable]
    public class GPUSkinningBoneAnimationTransition
    {
        public string m_Source;
        public string m_Target;
        public float m_ExitTime = 0;
        public float m_Duration = 0;
        public float m_Offset = 0;
    }
}
